<template>
  <!-- 考试列表 -->
  <div v-if="props.list.length === 0" class="no-data">暂无数据</div>
  <template v-for="(item, index) in props.list" :key="index">
    <nuxt-link target="_blank" :to="{ name: 'exam-detail', query: { id: item.id } }">
      <div class="exam-item">
        <!-- 考试名称 -->
        <div class="exam-name title"><exam-tag :exam-type="item.examType" />&nbsp;{{ item.examName }}</div>
        <!-- 考试信息 -->
        <exam-desc :item="item" />
        <el-divider />
        <div class="exam-price">
          <div>
            <span v-if="item.countStudy > 0">已有{{ item.countStudy + item?.countVirtualStudy }}人在考</span>
          </div>
          <common-price :price="item.price" :line-price="item.linePrice" />
        </div>
      </div>
    </nuxt-link>
  </template>
</template>
<script setup>
  const props = defineProps({
    list: {
      type: Array,
      default: () => []
    }
  })
</script>
<style lang="scss" scoped>
  .exam-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    background-color: #fff;
    border-radius: 5px;
    line-height: 30px;
    &:hover {
      outline: solid $main-color;
    }
    .exam-name {
      margin-bottom: 15px;
      overflow: hidden;
    }
    .exam-price {
      display: flex;
      justify-content: space-between;
    }
    .desc {
      margin-top: 15px;
      color: #777;
      line-height: 25px;
      height: 50px;
    }
  }
</style>
